Wildcards in a Global Replace
Unicode support in EMu does affect searching, and it is necessary to escape certain special search characters, wildcards for instance. Escaping a character involves preceding it with a backslash (\
). Thus to locate all words beginning with the letters fre
we search for fre\*
.
It is NOT necessary to escape wildcards in a Global Replace however.
Note: For a detailed examination of EMu's support for Unicode, take a look at Support for Unicode.
A number of wildcards can be included in the Global Replace Text to find field:
To use wildcards:
- Place the cursor at the position in the Text to find field where you require a wildcard.
- Select the Regular Expression checkbox (placing a tick in it).
- Click Wildcards....
A list of wildcards displays:
- Select one or more expressions from the list.
Special marker characters are added to the Text to find field. Some, such as Character in range, require you to edit the expression to specify the characters.
Tip: If you key these wildcard characters into the Text to find field rather than selecting them from the list of wildcards, be sure to select the Regular Expression checkbox (placing a tick in it).
The following table describes the wildcards:
Wildcard |
Name |
Description |
---|---|---|
|
Any character |
Matches any single character at that point in the Text to find field. For example, locating
and replacing with
will change a field that contains:
to:
|
|
Character in range |
Matches one of the enclosed characters at that point in the Text to find. Can be a range (using the hyphen) or specific characters (without the hyphen). For example:
matches: cat and cot
|
|
Beginning of value |
Matches a value at the start of the field (not within the field). For example, to locate the letter
Tip: ^ can be combined with $ to locate empty fields; and to locate and replace the entire contents of a field. See Uses of ^$ below. |
|
End of value |
Matches a value at the end of the field. As with Beginning of value. Tip: ^ can be combined with $ to locate empty fields; and to locate and replace the entire contents of a field. See Uses of ^$ below. |
Uses of
^$
Enter Note: ^Text to find$ Entering the text to find between ^ (which indicates the beginning of the field) and $ (which marks the end of the field) indicates that we're looking for (and replacing) the entire contents of the field. |
||
|
Beginning of word |
Matches text at the start of a word. For example, locating [[:<:]]sm and replacing with sp will change a field that contains: A useful option if you are a bad smeller to: A useful option if you are a bad speller |
|
End of word |
Matches text at the end of a word. As with Beginning of word. |
|
Expression |
An expression is used to group a number of characters together in order to apply the same wildcard character to the group. For example, a field contains:
To locate instances where abc appears twice and replace it with cba:
|
|
Alternative |
Use where more than one alternate character forms part of the search. For example: c(ar|ul)t matches cart or cult |
|
Not a character |
Specifies a character that is not to be part of the search. For example: c[^ao]t would locate and replace cut but not cat or cot. |
|
Num occurrences |
Specifies the number of times a letter is repeated in the search term. For example, a field contains:
To locate instances where C repeats from 2 to 5 times and replace with x:
|
|
Previous 1 or more |
Matches one or more occurrences of the previous character. For example, a field contains: ab abc, abcc, abccc, abcccc To locate instances where C occurs once or more than once and replace with d:
|
|
Previous 0 or more |
Matches zero or more occurrences of the previous character. For example, a field contains: ab abc, abcc, abccc, abcccc To locate instances where c does or does not occur in combination with ab and replace with x:
|
|
Previous 0 or 1 |
Matches zero or one occurrence of the previous character. For example, locating: abc? and replacing with: x will change a field that contains: ab abc, abcc to: x x xc |
|
Wildcard escape |
The wildcard escape character removes any special meaning associated with a character, e.g. abc\? matches abc? rather than ab or abc. |
Note: Examples of how to use wildcards in a multi-language environment are available here. These examples may be useful for understanding how Global Replace operates.